package main.java.game.terrain;

import java.util.List;

import main.java.game.Card;
import main.java.game.Game;
import main.java.game.combatant.Monster;


public class Cave extends Terrain {

	public Cave(String name) {
		super(name);
	}
	public void setTerrain(Game game){
		super.setTerrain(game);
		List<Card> listM =game.getAdventurePile();
		for(Card card: listM){
			if(card instanceof Monster){
				Monster monster = (Monster) card;
				monster.setAttack(monster.getAttack()+1);
				monster.setDefense(monster.getDefense()+1);
			}
		}	
		System.out.println("All the monsters have 1 additional attack point and 1 additional defense point!\n");
		
	}
	public void stopUsingTerrain(Game game){
		game.getDiscardPile().add(this);
		game.setTerrainPile(null);
		List<Card> listM =game.getAdventurePile();
		for(Card card: listM){
			if(card instanceof Monster){
				Monster monster = (Monster) card;
				monster.setAttack(monster.getAttack()-1);
				monster.setDefense(monster.getDefense()-1);
			}
		}	
	}
}
